import HTTP from './request'

// 获取验证码
export const getSMS = data => HTTP("auth/get/code", "POST", data, {}, false)
// 用户注册
export const registerAccount = data => HTTP("auth/registered/user", "POST", data, {}, false)
// 用户密码登录
export const getHome = data => HTTP("auth/login/passcode", "POST", data, {}, false)
// 用户验证码登录
export const getCodeLogin = data => HTTP("auth/login/sms", "POST", data, {}, false)
// 退出登录
export const byeHome = data => HTTP("auth/sign-out", "POST", data)
// 主页菜品获取
export const getIndexGoods = () => HTTP("api/get/all/dishes", "GET", {}, {}, false)
// 首页获取商品详情
export const getIndexGoodDetail = data => HTTP("api/get/dishes", "GET", data, {}, false)
// 首页获取分类后商品详情
export const getIndexCatGoods = data => HTTP("api/get/cate/dishes", "GET", data, {}, false)
// 获取我的会员卡
export const getMyVip = () => HTTP("member/get/mine/card", "GET")
// 暂停配送
export const stopGo = data => HTTP("member/up/card/status", "PUT", data)
// 创建订单
export const createOrder = data => HTTP("member/create/orders", "POST", data)
// 获取用户卡类型
export const getCardType = data => HTTP("member/query/card/type", "POST", data)
// 绑定卡号
export const bindCard = data => HTTP("member/binding/user/card", "PUT", data)
// 修改地址
export const getCommomAddress = data => HTTP("member/change/user/address", "PUT", data)
// 新增地址
export const addCommomAddress = data => HTTP("member/stick/user/address", "POST", data)
// 删除地址
export const deleteCommomAddress = data => HTTP("member/delete/user/address", "POST", data)
// 查看我的收货地址
export const getMyAddress = data => HTTP("member/get/user/address", "POST", data)
// 查看订单信息
export const getOrderInfo = data => HTTP(`member/get/all/orders`, "POST", data)
// 会员卡渲染商品
export const getMyCardGoods = data => HTTP('member/query/card/dishes', "POST", data)
// 修改订单下的商品
export const changeOrderGoods = data => HTTP('member/update/orders', "PUT", data)
// 获取用户登录状态
export const getUserLogin = () => HTTP('auth/user/login', "POST")
// 获取会员卡菜分类上限
export const getVipGoodsCatNum = data => HTTP('member/get/card/cap', 'POST', data)